<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3D轮播</title>
    <style type="text/css">
        /* 动画div1 3d旋转动画*/
        @keyframes rotar {
            from {
                transform: rotateY(0deg);
            } to {
                  transform: rotateY(360deg);
              }
        }
        /* 视角 */
        .div1{
            perspective: 1000px;
            background-color: gray;
        }
        /* div1引用3d旋转动画 并变为3d效果*/
        .div2{
            width: 200px;
            margin: 100px auto;
            animation: rotar 15s infinite linear;
            transform-style: preserve-3d;
            position: absolute;
            left: 50%;
        }
       /* 给每个img设置2d3d旋转*/
        .img1{
            transform: rotateY(0deg) translateZ(300px);
        }
        .img2{
            transform: rotateY(40deg) translateZ(300px);
        }
        .img3{
            transform: rotateY(80deg) translateZ(300px);
        }
        .img4{
            transform: rotateY(120deg) translateZ(300px);
        }
        .img5{
            transform: rotateY(160deg) translateZ(300px);
        }
        .img6{
            transform: rotateY(200deg) translateZ(300px);
        }
        .img7{
            transform: rotateY(240deg) translateZ(300px);
        }
        .img8{
            transform: rotateY(280deg) translateZ(300px);
        }
        .img9{
            transform: rotateY(320deg) translateZ(300px);
        }
        /*图片悬停暂停*/
        img:hover {
            transform: scale(1.2);
            transition: all 300ms;
        }
        /* 悬停暂停动画 并改变鼠标样式*/
        .div2:hover{
            animation-play-state: paused;
            cursor: pointer;
        }
        /*放大超出部分隐藏  绝对定位：防止div独占一行  */
        .div2>div{
            position: absolute;
            overflow: hidden;
            width: 200px;
            height: 93px;
            box-shadow: 0px 0px 20px 0px #000;
            border-radius: 5px;
        }
    </style>
</head>
<body>
<!--背景颜色 相对定位-->
<div class="div1">
    <!--3dY轴旋转 绝对定位 居中-->
    <div class="div2">
        <div class="img1"><img src="Data/redqun.png"></div>
        <div class="img2"><img src="Data/redqun.png"></div>
        <div class="img3"><img src="Data/redqun.png"></div>
        <div class="img4"><img src="Data/redqun.png"></div>
        <div class="img5"><img src="Data/redqun.png"></div>
        <div class="img6"><img src="Data/redqun.png"></div>
        <div class="img7"><img src="Data/redqun.png"></div>
        <div class="img8"><img src="Data/redqun.png"></div>
        <div class="img9"><img src="Data/redqun.png"></div>
    </div>
</div>
</body>
</html>